<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/modelo/templateComMenu.xhtml">
        <ui:define name="conteudo">
            <h:form id="formAvaliacao">
                <p:panel id="panel"
                         header="Listagem de Participantes">
                    <p:dataTable id="tabela"
                                 value="#{participanteBean.participantes}"
                                 var="p">
                        <p:column headerText="Nome"
                                  filterBy="#{p.nome}">
                            <div align="center">
                                <span>#{p.nome}</span>
                            </div>
                        </p:column>

                        <p:column headerText="Situação">
                            <div align="center">
                                <span>#{p.situacao}</span>
                            </div>
                        </p:column>

                        <p:column headerText="Deferir">
                            <div align="center">
                                <p:commandButton id="cbDeferir"
                                                 icon="ui-icon-circle-check"
                                                 update="tabela"
                                                 action="#{avaliarBean.deferir()}">
                                    <f:setPropertyActionListener
                                        value="#{p}"
                                        target="#{avaliarBean.participante}"/>
                                </p:commandButton>
                            </div>
                        </p:column>

                        <p:column headerText="Indeferir">
                            <div align="center">
                                <p:commandButton id="cbIndeferir"
                                                 icon="ui-icon-circle-close"
                                                 update="tabela"
                                                 action="#{avaliarBean.indeferir()}">
                                    <f:setPropertyActionListener
                                        value="#{p}"
                                        target="#{avaliarBean.participante}"/>
                                </p:commandButton>
                            </div>
                        </p:column>

                        <p:column headerText="Resumo">
                            <div align="center">
                                <p:commandButton id="cbResumo"
                                                 ajax="false"
                                                 icon="ui-icon-document"
                                                 action="#{avaliarBean.visualizarPDF()}">
                                    <f:setPropertyActionListener
                                        value="#{p}"
                                        target="#{avaliarBean.participante}"/>
                                </p:commandButton>
                            </div>
                        </p:column>
                    </p:dataTable>
                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>
</html>

